// 方法一
console.time('method1');
function create(param) {
    return new Promise((resolve, reject) => {
        setTimeout(resolve, 10, param);
    });
}
const pA = create('hello');
const pB = create('lagou');
const pC = create('I ❤ U');

Promise.all([pA, pB, pC]).then((values) => {
    console.log(values.reduce((prev, curr) => prev + curr));
    console.timeEnd('method1');
});

// 方法二
console.time('method2')
new Promise((resolve, reject) => {
    setTimeout(resolve, 10, 'hello');
}).then(result => {
    return new Promise((resolve, reject) => {
        setTimeout(resolve, 10, result + 'lagou');
    })
}).then(result => {
    setTimeout(() => {
        console.log(result + 'I ❤ U');
        console.timeEnd('method2');
    }, 10);
});